package com.yunlc.kubernetes.traefik.models;

import com.google.gson.annotations.SerializedName;
import io.kubernetes.client.models.V1ListMeta;
import io.swagger.annotations.ApiModelProperty;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class TraefikV1alpha1MiddlewareList {

    @SerializedName("apiVersion")
    private String apiVersion = null;

    @SerializedName("items")
    private List<TraefikV1alpha1Middleware> items = new ArrayList<TraefikV1alpha1Middleware>();

    @SerializedName("kind")
    private String kind = null;

    @SerializedName("metadata")
    private V1ListMeta metadata = null;

    public TraefikV1alpha1MiddlewareList apiVersion(String apiVersion) {
        this.apiVersion = apiVersion;
        return this;
    }

    /**
     * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
     * @return apiVersion
     **/
    @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources")
    public String getApiVersion() {
        return apiVersion;
    }

    public void setApiVersion(String apiVersion) {
        this.apiVersion = apiVersion;
    }

    public TraefikV1alpha1MiddlewareList items(List<TraefikV1alpha1Middleware> items) {
        this.items = items;
        return this;
    }

    public TraefikV1alpha1MiddlewareList addItemsItem(TraefikV1alpha1Middleware itemsItem) {
        this.items.add(itemsItem);
        return this;
    }

    /**
     * Items is the list of Ingress.
     * @return items
     **/
    @ApiModelProperty(required = true, value = "Items is the list of Ingress.")
    public List<TraefikV1alpha1Middleware> getItems() {
        return items;
    }

    public void setItems(List<TraefikV1alpha1Middleware> items) {
        this.items = items;
    }

    public TraefikV1alpha1MiddlewareList kind(String kind) {
        this.kind = kind;
        return this;
    }

    /**
     * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
     * @return kind
     **/
    @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds")
    public String getKind() {
        return kind;
    }

    public void setKind(String kind) {
        this.kind = kind;
    }

    public TraefikV1alpha1MiddlewareList metadata(V1ListMeta metadata) {
        this.metadata = metadata;
        return this;
    }

    /**
     * Standard object&#39;s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
     * @return metadata
     **/
    @ApiModelProperty(value = "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
    public V1ListMeta getMetadata() {
        return metadata;
    }

    public void setMetadata(V1ListMeta metadata) {
        this.metadata = metadata;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TraefikV1alpha1MiddlewareList v1alpha1IngressList = (TraefikV1alpha1MiddlewareList) o;
        return Objects.equals(this.apiVersion, v1alpha1IngressList.apiVersion) &&
                Objects.equals(this.items, v1alpha1IngressList.items) &&
                Objects.equals(this.kind, v1alpha1IngressList.kind) &&
                Objects.equals(this.metadata, v1alpha1IngressList.metadata);
    }

    @Override
    public int hashCode() {
        return Objects.hash(apiVersion, items, kind, metadata);
    }


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class TraefikV1alpha1IngressList {\n");

        sb.append("    apiVersion: ").append(toIndentedString(apiVersion)).append("\n");
        sb.append("    items: ").append(toIndentedString(items)).append("\n");
        sb.append("    kind: ").append(toIndentedString(kind)).append("\n");
        sb.append("    metadata: ").append(toIndentedString(metadata)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }

}
